#include "../Tools/nvMath.h"

using namespace nv;

class QuatCamera
{
public:
	quaternionf rotX;
	quaternionf rotY;
	quaternionf rotZ;

	vec3f location;
	vec3f direction;
	float pitch;
	float yaw;
	

	QuatCamera()
	{
		rotX.w = 1.0f;
		rotY.w = 1.0f;
		rotZ.w = 1.0f;

		pitch = 0.0f;
		yaw = 0.0f;

		location.x = 0.0f;
		location.y = 0.0f;
		location.z = 0.0f;

		direction.x = 1.0f;
		direction.y = 0.0f;
		direction.z = 0.0f;
	}

	
	void Pitch(float angle)
	{
		vec3f vc;
		vc.x = 1.0f;
		vc.y = 0.0f;
		vc.z = 0.0f;

		pitch += angle;
		rotX.set_value(vc, pitch);
		//rotX.scale_angle(angle);
	}

	void Yaw(float angle)
	{
		vec3f vc;
		vc.x = 0.0f;
		vc.y = 1.0f;
		vc.z = 0.0f;

		yaw += angle;

		rotY.set_value(vc, yaw);
		//rotY.scale_angle(angle);
	}

	void Move(float move)
	{
		vec3f vc;

		vc.x = 0.0f;
		vc.y = 0.0f;
		vc.z = 1.0f;

		//rotX.get_value(vc, rad);

		rotX.mult_vec(vc);

		location.x += vc.x * move;
		location.y += -vc.y * move;
		location.z += vc.z * move;
		//location.x += vc.x * move;
	}

	void Strafe(float strafe)
	{
		//
	}

	void GetMatrix(matrix4f &m)
	{
		quaternionf res;
		res = rotX * rotY * rotZ;
		res.get_value(m);
	}
	//
};